package com.bbc.commonbackstage.common.mybatisplus.base;

import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.ArrayList;
import java.util.List;

/**
 * Tree基类
 *
 * @author ruoyi
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel("Tree基类")
public class TreeEntity<T> extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /** 父菜单名称 */
    @ApiModelProperty("父级名称")
    private String parentName;

    /** 父菜单ID */
    @ApiModelProperty("父级ID")
    private Long parentId;

    /** 显示顺序 */
    @ApiModelProperty("显示顺序")
    private Integer orderNum;

    /** 祖级列表 */
    @ApiModelProperty("祖级列表")
    private String ancestors;

    /** 子部门 */
    @TableField(exist = false)
    @ApiModelProperty("子级列表")
    private List<T> children = new ArrayList<>();

}
